<?php
require ('./includes/config.inc.php');

if(isset($_GET['type']) && ($_GET['type']== 'goodies'))	{
	$page_title = 'Our goodies, by Category';
	$sp_type = 'other';
	$type = 'goodies';
}else{	// Default
	$page_title = 'Our carts Products';
	$type = $sp_type = 'carts';
}

include ('./includes/header.html');
require(MYSQL);

$r = mysqli_query($dbc, "CALL select_categories('$sp_type')");

if(!$r)
	echo mysqli_error($dbc);
	
if(mysqli_num_rows($r) >= 1)	{
	include('./views/list_categories.html');
}else {
	include('./views/error.html');
}
include('./includes/footer.html');
?>